﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class admin_AdminApply : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["studIdcard"] != null)
        {
            if (!Page.IsPostBack)
            {
                bindDataTable();

                DataTable dt = Exam.GetExamDisplayNameByTime();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow typeName in dt.Rows)
                    {
                        ListItem liType = new ListItem(typeName["EmAllName"].ToString());
                        List_ExamAllName.Items.Add(liType);
                    }
                }
            }
        }
    }
    private void bindDataTable()
    {
        DataTable dt = Exam.getAllApplyInfos();
        if (dt.Columns.Contains("ApplyStateCHN"))
            dt.Columns.Remove("ApplyStateCHN");
        dt.Columns.Add("ApplyStateCHN");
        foreach (DataRow dr in dt.Rows)
        {
            dr["ApplyStateCHN"] = int.Parse(dr["ApplyState"].ToString()) > 1 ? "已完成" : "未完成";
        }
        gv.DataSource = dt;
        gv.DataBind();
    }

    protected void List_ExamAllName_Changed(object sender, EventArgs e)
    {
        //Response.Write("<script>alert(1);</script>");
        BSUtility.WindowAlert(this, "test");
    }
}